package com.qing.demo01.controller;

import com.qing.demo01.entity.UserInfo;
import com.qing.demo01.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.UUID;


@Controller
public class LoginController {


	@Autowired
	private UserService userService;


	@GetMapping("/login")
	@ResponseBody
	private String login(HttpServletRequest request) {
		String uuid = UUID.randomUUID().toString();

		HttpSession session = request.getSession();
		session.setAttribute("uuid", uuid);
		return uuid;
	}
}
